# for循环
# 打印1-10
# range 是一个内建函数 range(beg,end)=>[beg,end)
# range 还提供了第三个参数，表示‘步长’ 默认步长是1
for i in range(1,11):
    print(i)


# 打印2，4，6，8，10
for i in range(2,12,2):
    print(i)


# 打印从10-1
num = 1
while num >= 1:
    print(num)
    num -= 1


for i in range(10,0,-1):
    print(i)


# 求1+2+3+4+...+100
theSum = 0
for i in range(1,101):
    theSum += i
print(f'sum = {theSum}')